package com.fp.m7.client.view;

import com.fp.m7.client.presenter.InfoPresenter;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HasText;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.SimplePanel;

/**
 * A view for a single info event element. Usually displays some short user-actions-related messages.
 * 
 * @author 7
 */
public class InfoView extends Composite implements InfoPresenter.Display {

    private SimplePanel panel;
    private Label message;

    public InfoView() {
        panel = new SimplePanel();
        message = new Label();
        panel.add(message);

        initWidget(panel);
        panel.setStyleName("infoPopup");
    }

    @Override
    public HasText getMessage() {
        return message;
    }

    @Override
    public void setInfo() {
        message.setStyleName("info");
    }

    @Override
    public void setWarning() {
        message.setStyleName("warning");
    }

    @Override
    public void setSuccess() {
        message.setStyleName("success");
    }

}
